package cz.via.wowss.helper;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public final class CompanyTypeConnections {

	private static HashMap<CompanyType, List<CompanyTypeConnection>> connections;

	public static HashMap<CompanyType, List<CompanyTypeConnection>> getConnections() {
		if (connections == null) {
			createConnections();
		}
		return connections;
	}
	
	public static List<CompanyTypeConnection> getCompanyConnections(CompanyType ct) {
		if (connections == null)
			return null;
		return connections.get(ct);
	}
	
	private static void createConnections() {
		List<CompanyTypeConnection> list = new ArrayList<CompanyTypeConnection>();
		
		list.add(new CompanyTypeConnection(CompanyType.FOSILNI_ENERGETIKA, CompanyType.TEZARSTVI_UHLI, 0.2));
		list.add(new CompanyTypeConnection(CompanyType.FOSILNI_ENERGETIKA, CompanyType.TEZARSTVI_ZEMNIHO_PLYNU, 0.2));
		list.add(new CompanyTypeConnection(CompanyType.FOSILNI_ENERGETIKA, CompanyType.TEZARSTVI_ROPY, 0.2));
		connections.put(CompanyType.FOSILNI_ENERGETIKA, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.CHOV, CompanyType.PESTOVANI, 0.3));
		connections.put(CompanyType.CHOV, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.RYBOLOV, CompanyType.LODARSTVI, 0.2));
		connections.put(CompanyType.RYBOLOV, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.SPOTREBNI_ELEKTRONIKA, CompanyType.TEZARSTVI_LEHKYCH_KOVU, 0.25));
		connections.put(CompanyType.SPOTREBNI_ELEKTRONIKA, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.PRUMYSLOVA_ELEKTRONIKA, CompanyType.TEZARSTVI_LEHKYCH_KOVU, 0.15));
		list.add(new CompanyTypeConnection(CompanyType.PRUMYSLOVA_ELEKTRONIKA, CompanyType.TEZARSTVI_OSTATNICH_KOVU, 0.15));
		connections.put(CompanyType.PRUMYSLOVA_ELEKTRONIKA, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.DOPRAVNI_STAVEBNICTVI, CompanyType.OSTATNI_TEZARSTVI, 0.2));
		connections.put(CompanyType.DOPRAVNI_STAVEBNICTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.STAVBA_BUDOV, CompanyType.OSTATNI_TEZARSTVI, 0.2));
		connections.put(CompanyType.STAVBA_BUDOV, list);	
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.POTRAVINARSTVI, CompanyType.CHOV, 0.3));
		list.add(new CompanyTypeConnection(CompanyType.POTRAVINARSTVI, CompanyType.RYBOLOV, 0.3));
		list.add(new CompanyTypeConnection(CompanyType.POTRAVINARSTVI, CompanyType.PESTOVANI, 0.3));
		connections.put(CompanyType.POTRAVINARSTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.PILA, CompanyType.TEZBA_DREVA, 0.6));
		connections.put(CompanyType.PILA, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.TRUHLARSTVI, CompanyType.PILA, 0.4));
		connections.put(CompanyType.TRUHLARSTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.PAPIRNICTVI, CompanyType.TEZBA_DREVA, 0.5));
		connections.put(CompanyType.PAPIRNICTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.HUTNICTVI, CompanyType.TEZARSTVI_LEHKYCH_KOVU, 0.3));
		list.add(new CompanyTypeConnection(CompanyType.HUTNICTVI, CompanyType.TEZARSTVI_OSTATNICH_KOVU, 0.3));
		connections.put(CompanyType.HUTNICTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.ZPRACOVATELSTVI_ROPY_PLYNU, CompanyType.TEZARSTVI_ROPY, 0.3));
		list.add(new CompanyTypeConnection(CompanyType.ZPRACOVATELSTVI_ROPY_PLYNU, CompanyType.TEZARSTVI_UHLI, 0.3));
		connections.put(CompanyType.ZPRACOVATELSTVI_ROPY_PLYNU, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.VYROBA_STROJU, CompanyType.HUTNICTVI, 0.4));
		connections.put(CompanyType.VYROBA_STROJU, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.VYROBA_AUTOMOBILU, CompanyType.HUTNICTVI, 0.25));
		list.add(new CompanyTypeConnection(CompanyType.VYROBA_AUTOMOBILU, CompanyType.HUTNICTVI, 0.15));
		connections.put(CompanyType.VYROBA_AUTOMOBILU, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.LODARSTVI, CompanyType.PILA, 0.2));
		list.add(new CompanyTypeConnection(CompanyType.LODARSTVI, CompanyType.HUTNICTVI, 0.2));
		connections.put(CompanyType.LODARSTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.SPERKARSTVI, CompanyType.TEZARSTVI_VZACNYCH_KOVU, 0.4));
		connections.put(CompanyType.SPERKARSTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.ODEVNICTVI, CompanyType.CHOV, 0.2));
		list.add(new CompanyTypeConnection(CompanyType.ODEVNICTVI, CompanyType.PESTOVANI, 0.2));
		connections.put(CompanyType.ODEVNICTVI, list);
		
		list = new ArrayList<CompanyTypeConnection>();
		list.add(new CompanyTypeConnection(CompanyType.SKLENARSTVI_KERAMIKA, CompanyType.OSTATNI_TEZARSTVI, 0.3));
		connections.put(CompanyType.SKLENARSTVI_KERAMIKA, list);
		
	}
}
